function loadUserBooks(){
    $.ajax({
        url: base_url+"/notebook/loadbooks.do",
        type: "POST",
        data: {"userId":userId},
        dataType: "json",
        success: function (result) {
            //alert("success")
            if(result.status == 0){
                //和获取笔记本数组
                var books = result.data;
                //console.log(books)
                for (var i = 0;i < books.length;i++){
                    var bookName = books[i].cn_notebook_name
                    var bookId = books[i].cn_notebook_id
                    //console.log(bookName,bookId)
                    createBookLi(bookName,bookId)
                }
            }
        },
        error:function () {
            alert("加载笔记列表失败")
        }
    })
}

function createBookLi(bookName,bookId){
    var s_li='<li class="online">';
    s_li += '<a>';
    s_li += '<i class="fa fa-book" title="online" rel="tooltip-bottom">';
    s_li += '</i> '+bookName;
    s_li += '</a>';
    s_li += '</li>';
    //将bookId与li绑定
    var $li = $(s_li)
    $li.data("bookId",bookId)
    //将li元素添加给ul
    $("#book_list").append($li)

}
